package com.cande.loki.jmh.redis;

import java.util.HashMap;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;

public class TestRedis {

    public static void main(String[] args) throws InterruptedException {
        TreeMap treeMap = new TreeMap();
        treeMap.put(1,1);
        treeMap.put(5,2);
        treeMap.put(9,3);
        System.out.println(treeMap.floorKey(3));
        String account1 = "5";
        String account5 = "5";
        System.out.println(account5.compareTo(account1));
        System.out.println(account1.compareTo(account5));

        String account = "1^5";
        System.out.println( account.substring(0,account.indexOf("^")));
        System.out.println( account.substring(account.indexOf("^")+1));


//        HashMap<String,String> concurrentHashMap = new HashMap();

//        ConcurrentHashMap<String,String> concurrentHashMap = new ConcurrentHashMap();
//
//        concurrentHashMap.put("1","1");
//        concurrentHashMap.put("2","1");
//        concurrentHashMap.put("3","1");
//
//        new Thread(()->{
//            while (true) {
//                concurrentHashMap.forEach((k,v) -> {
//                    System.out.println(v);
//                });
//            }
//        }).start();
//
//        new Thread(()->{
//            while (true) {
//                concurrentHashMap.put("1", "1000");
//            }
//        }).start();



    }
}
